      SUBROUTINE ARANGE
C
C        'ARANGE' CONVERTS THE FORTRAN SYMBOL OF THE COMPUTED DEPENDENT
C        VARIABLES TO THE FORTRAN SYMBOL USED IN THE DATA OUTPUT
C
        IMPLICIT REAL*8 (A-H,O-Z)
C
C
      COMMON/CANTNA/ A(10,3),ADOT(10,3),B(10,3),BDOT(10,3),DIN(10,3),
     .               DINDOT(10,3),DOUT(10,3),DOUTDT(10,3)
C
      COMMON/DEBUG2/ IOUT,JOUT,KLUGE
C
      COMMON/ELMNTS/ NELMTS,NDAMPR
C
      COMMON/IMAIN1/ IDATE,LSAVE,INOPT,IPLOT,NUMEQS,IPLTPE,IORB,ITAPE
C
      COMMON/IPOOL1/ IGRAV,IDAMP,IK,K1,ITIM,IAB,IAPS,IBB,IBPS,NK(10),
     .               LK(10),LLK(10)
      COMMON/MRANG/ ADDOT(10,3),BDDOT(10,3),DOUTDD(10,3),DINDD(10,3)
C
C
      COMMON/VARBLS/ DEPEND(150),DERIV(150)
C
C
      IKOUNT=9
      IF(IDAMP.EQ.1) IKOUNT=11
      NELMTS=IK-K1
      NDAMPR=K1
      N=NUMEQS
C
C
      DO 30 K=1,IK
      M=NK(K)
      IF(M.EQ.0) GO TO 30
      L=K - K1
      DO 10 I=1,M
      IKOUNT=IKOUNT + 1
      IF(K.LE.K1) DOUT(K,I)=DEPEND(IKOUNT)
      IF(K.GT.K1) A(L,I)=DEPEND(IKOUNT)
   10 CONTINUE
C
      DO 20 I=1,M
      IKOUNT=IKOUNT + 1
      IF(K-K1) 15,15,17
   15 DOUTDT(K,I)=DEPEND(IKOUNT)
      DOUTDD(K,I)=DERIV(IKOUNT)
      GO TO 20
   17 ADOT(L,I)=DEPEND(IKOUNT)
      ADDOT(L,I)=DERIV(IKOUNT)
   20 CONTINUE
   30 CONTINUE
C
      DO 60 K=1,IK
      M=NK(K)
      IF(M.EQ.0) GO TO 60
      L=K - K1
      DO 40 I=1,M
      IKOUNT=IKOUNT + 1
      IF(K.LE.K1) DIN(K,I)=DEPEND(IKOUNT)
      IF(K.GT.K1) B(L,I)=DEPEND(IKOUNT)
   40 CONTINUE
      DO 50 I=1,M
      IKOUNT=IKOUNT + 1
      IF(K-K1) 45,45,47
   45 DINDOT(K,I)=DEPEND(IKOUNT)
      DINDD(K,I)=DERIV(IKOUNT)
      GO TO 50
C
   47 BDOT(L,I)=DEPEND(IKOUNT)
      BDDOT(L,I)=DERIV(IKOUNT)
   50 CONTINUE
   60 CONTINUE
C
C
      IF(IOUT.EQ.1) RETURN
      WRITE(6,10000)
      WRITE(6,10001) (DEPEND(I),I=1,N)
      WRITE(6,10002)
      WRITE(6,10003) (I,(A(I,J),J=1,3),I=1,IK)
      WRITE(6,10004)
      WRITE(6,10003) (I,(ADOT(I,J),J=1,3),I=1,IK)
      WRITE(6,10005)
      WRITE(6,10003) (I,(B(I,J),J=1,3),I=1,IK)
      WRITE(6,10006)
      WRITE(6,10003) (I,(BDOT(I,J),J=1,3),I=1,IK)
      IF(K1.EQ.0) RETURN
      WRITE(6,10007)
      WRITE(6,10003) (I,(DIN(I,J),J=1,3),I=1,K1)
      WRITE(6,10008)
      WRITE(6,10003) (I,(DINDOT(I,J),J=1,3),I=1,K1)
      WRITE(6,10009)
      WRITE(6,10003) (I,(DOUT(I,J),J=1,3),I=1,K1)
      WRITE(6,10010)
      WRITE(6,10003) (I,(DOUTDT(I,J),J=1,3),I=1,K1)
C
      RETURN
10000 FORMAT('0',2X,'DEPEND FROM ARANGE')
C
10001 FORMAT(' ',1X,6G15.8)
C
10002 FORMAT('0',2X,'A(I,J)')
C
10003 FORMAT('0',1X,I3,3G15.8)
C
10004 FORMAT('0',2X,'ADOT(I,J)')
C
10005 FORMAT('0',2X,'B(I,J)')
C
10006 FORMAT('0',2X,'BDOT(I,J)')
C
10007 FORMAT('0',2X,'DIN(I,J)')
C
10008 FORMAT('0',2X,'DINDOT(I,J)')
C
10009 FORMAT('0',2X,'DOUT(I,J)')
C
10010 FORMAT('0',2X,'DOUTDT(I,J)')
C
C
      END
